package com.hinnotek.amoeba.adapters.old

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.hinnotek.amoeba.R
import com.hinnotek.amoeba.bean.old.NoticePageByUserIdBean

/**
 * "通知"列表适配器
 * @author 张洋
 * @since 2020-10-7
 */
class HomeManagerMsgListRecyclerAdapter :
    BaseQuickAdapter<NoticePageByUserIdBean, BaseViewHolder>(R.layout.item_home_manager_msg_list) {
    override fun convert(holder: BaseViewHolder, item: NoticePageByUserIdBean) {
        holder.setText(R.id.tv_amoeba_name, item.orgName)
        holder.setText(R.id.tv_applicant, item.createUser)
        holder.setText(R.id.tv_application_type, item.noticeType)
        holder.setText(R.id.tv_application_date, item.createTime)
        when (item.noticeState) {
            1 -> holder.setText(R.id.tv_approve, "等待我处理")
            2 -> holder.setText(R.id.tv_approve, "已通过")
            3 -> holder.setText(R.id.tv_approve, "已拒绝")
            4 -> holder.setText(R.id.tv_approve, "已撤回")
        }
    }
}